package cn.attackme.myuploader.controller;

import cn.attackme.myuploader.service.PlanService;
import cn.attackme.myuploader.utils.ResultUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/plan")
public class PlanController {
    @Autowired
    private PlanService planService;

    @RequestMapping(value="all", method = RequestMethod.POST)
    public Map<String,Object> find() throws IOException {
        System.out.println("plan 进入");
        List<Map<String,Object>> plan_all = planService.allplan();
        Map<String,Object> resultMap = ResultUtils.getResponse(plan_all,"succeed",
                "internal error",false);
        return resultMap;
    }

}
